|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfileclassification.FileClassification
public class FileClassification
| Constructor Summary | |
|---|---|
FileClassification()
|
|
| Method Summary | |
|---|---|
static void |
createFile(java.lang.String fileName)
Creates file. |
static java.lang.String |
exportPDF(java.lang.String directory,
java.lang.String name)
When the PDF structure is recognized, returns string with exported textual data of a PDF file. |
static java.lang.String |
exportXML(java.lang.String directory,
java.lang.String file)
Returns string with exported textual data of a PDF file. |
static void |
inDirectory(java.io.File directory,
java.lang.String saveDirectory,
int choice)
Saves and prints occurrences of features of all files in one table. |
static int[] |
loadDOCX(java.lang.String directory,
java.lang.String file)
Returns an array of occurrences of features that belong to DOCX file. |
static int[] |
loadODT(java.lang.String directory,
java.lang.String name)
Returns an array of occurrences of features that belong to DOCX file. |
static int[] |
loadPDF(java.lang.String directory,
java.lang.String file)
Returns an array of occurrences of each PDF object. |
static void |
main(java.lang.String[] args)
In this main method is programmed logic of the whole application. |
static void |
saveFile(java.lang.String text,
java.lang.String directory,
java.lang.String name)
Saves given textual data to the .txt file. |
static boolean |
testDOCX(int[] loadedDOCX,
java.lang.String name)
Returns "false" in case that given file does not contain the DOCX structure, returns "true" when file is automatically recognized as DOCX file. |
static boolean |
testODT(int[] loadedODT,
java.lang.String name)
Returns "false" in case that given file does not contain the ODT structure, returns "true" when file is automatically recognized as ODT file. |
static boolean |
testPDF(int[] loadedPDF,
java.lang.String name)
Returns "false" in case that given file does not contain the PDF structure, returns "true" when file is automatically recognized as PDF. |
static boolean |
testSingleDOCX(java.lang.String directory,
java.lang.String name)
Returns "false" in case that given file does not contain the DOCX structure, returns "true" when file is automatically recognized as DOCX. |
static boolean |
testSingleODT(java.lang.String directory,
java.lang.String name)
Returns "false" in case that given file does not contain the ODT structure, returns "true" when file is automatically recognized as ODT. |
static boolean |
testSinglePDF(java.lang.String directory,
java.lang.String name)
Returns "false" in case that given file does not contain the PDF structure, returns "true" when file is automatically recognized as PDF. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileClassification()
| Method Detail |
|---|
public static boolean testSinglePDF(java.lang.String directory,
java.lang.String name)
directory - an absolute path of directoryname - the name of the file within directory
public static int[] loadPDF(java.lang.String directory,
java.lang.String file)
directory - an absolute path of directoryfile - the name of the file within directory
public static boolean testPDF(int[] loadedPDF,
java.lang.String name)
loadedPDF - array containing occurrences of objectsname - the name of given file
public static java.lang.String exportPDF(java.lang.String directory,
java.lang.String name)
The textual data within the string are encoded and may contain images. In most cases it is encoded by one of these algorithms: FlateDecode, ASCIIHexDecode, JBIG2Decode, etc. In return string you can find tags witch represent determine algorithm for text decoding.
directory - an absolute path of directoryname - the name of the file within directory
public static boolean testSingleDOCX(java.lang.String directory,
java.lang.String name)
directory - an absolute path of directoryname - the name of the file within directory
public static int[] loadDOCX(java.lang.String directory,
java.lang.String file)
directory - an absolute path of directoryfile - the name of the file within directory
public static boolean testDOCX(int[] loadedDOCX,
java.lang.String name)
loadedDOCX - array containing occurrences of objectssname - the name of given file
public static java.lang.String exportXML(java.lang.String directory,
java.lang.String file)
The textual data within the DOCX file are compressed in one ZIP packet. If file contains textual data in ZIP packet is corrupted is not able to export textual data.
This method works for both XML-based office files (DOCX, ODT).
directory - an absolute path of given directoryfile - the name of the file within directory
public static boolean testSingleODT(java.lang.String directory,
java.lang.String name)
directory - an absolute path of directoryname - the name of the file within directory
public static int[] loadODT(java.lang.String directory,
java.lang.String name)
directory - an absolute path of directoryname - the name of the file within directory
public static boolean testODT(int[] loadedODT,
java.lang.String name)
loadedODT - array containing occurrences of objectssname - the name of given file
public static void inDirectory(java.io.File directory,
java.lang.String saveDirectory,
int choice)
directory - an absolute path of given directorysaveDirectory - an absolute path to save table containing occurrences of features of filechoice - represents which file structure should be tested: 1. PDF, 2. DOCX, 3. ODTpublic static void createFile(java.lang.String fileName)
fileName - name of created file
public static void saveFile(java.lang.String text,
java.lang.String directory,
java.lang.String name)
text - given textual datadirectory - an absolute path to save filename - name of save filepublic static void main(java.lang.String[] args)
For run application is required insert arguments.
Type of argument for analyze all files in directory:
PDF - testFilesPDF
DOCX - testFilesDOCX
ODT - testFilesODT
for analyze single file:
PDF - singlePDF
DOCX - singleDOCX
ODT - singleODT
args - [0] = given directory, [1] = save directory, [2] = choice
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||